package service;

import java.util.Date;
import java.util.List;

import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;

import dto.LieuVO;
import dto.TrajetVO;
import dto.VoyageVO;

@Stateless
@Local
// @Remote
public class GestionConsultationBean implements GestionConsultation {

	private ServiceVoyageDao serviceVoyageDao;
	private ServiceLieuDao serviceLieuDao;
	private ServiceTrajetDao serviceTrajetDao;

	@EJB(beanName = "ServiceVoyageDaoBean")
	public void setServiceVoyageDao(ServiceVoyageDao serviceVoyageDao) {
		this.serviceVoyageDao = serviceVoyageDao;
	}

	@EJB(beanName = "ServiceLieuDaoBean")
	public void setServiceLieueDao(ServiceLieuDao serviceLieuDao) {
		this.serviceLieuDao = serviceLieuDao;
	}

	@EJB(beanName = "ServiceTrajetDaoBean")
	public void setServiceTrajetDao(ServiceTrajetDao serviceTrajetDao) {
		this.serviceTrajetDao = serviceTrajetDao;
	}

	public List<LieuVO> getAllLieux() {
		return serviceLieuDao.getAllLieux();
	}

	public List<VoyageVO> getAllVoyages() {
		return serviceVoyageDao.getAllVoyages();
	}

	public VoyageVO getVoyageById(long id){
		return serviceVoyageDao.getVoyageById(id);
	}

	@Override
	public List<TrajetVO> getTrajets(String depart, String arrivee, Date allee,
			Date retour) {
		return serviceTrajetDao.getTrajets(depart, arrivee, allee, retour);
	}

}
